package com.top.art.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * The type Protocol.
 *
 * @param <T> the type parameter
 * @author hjh
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ResVO<T> implements Serializable {

    private static final long serialVersionUID = -3374377238757831251L;

    /**
     * code
     */
    private Integer code;
    /**
     * message
     */
    private String message;

    /**
     * result
     */
    private T result;


    /**
     * Instantiates a new Protocol.
     *
     * @param object the object
     */
    public ResVO(T object) {
        this(0, "ok", object);
    }

    /**
     * Instantiates a new Protocol.
     *
     * @param code the code
     * @param message the message
     */
    public ResVO(int code, String message) {
        this(code, message, null);
    }
}
